# -*- coding: utf-8 -*-
# flake8: noqa

from qiniu import Auth, put_file, urlsafe_base64_encode, PersistentFop

access_key = 'wkJupck8Ylduede0ny9KSsIG4vqwDkelgBfejKSv'
secret_key = 'i4UrEdihv93LUun8MMG_OCAcGQHwPU6ZiHq5ijMg'

q = Auth(access_key, secret_key)

bucket_name = 'lxhlxhlxh'

key = 'mkzip27.txt'

# 可以对转码后的文件进行使用saveas参数自定义命名，当然也可以不指定文件会默认命名并保存在当前空间
fops = 'mkzip/4/encoding/dXRmLTg=|saveas/cmVzdWx0LnppcA=='

# 转码是使用的队列名称
pipeline = 'gebo1'

pfop = PersistentFop(q, bucket_name, pipeline)
ops = [fops]
ret, info = pfop.execute(key, ops, 1)
print(info)
print('persistentId: ' + ret['persistentId'])
